<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>测试使用定时事件</title>
	 <%String path = request.getContextPath(); %>
	<script type="text/javascript" src="<%=path%>/js/jquery.js"></script>
	<script type="text/javascript">
        $(function  () {

           alertDistance () ;

        })

        var i = 1;

        /*window.setInterval(alertDistance, 3000);*/
        window.setInterval(alertPrint, 5000);
        window.setTimeout(setTest, 10000);
        /*根据车牌查询状态*/
       function alertDistance () {
       	console.log("kaishizhixing");
       }

       function setTest () {
       		 $("#test").val("0");
       }

       function alertPrint () {
       	 var test = $("#test").val();
       	 console.log("alertPrint");
           if (test==0) {
           	  console.log("开始刷新");
           	 window.location.reload;
           }
       }
	</script>
</head>
<body>
	 <input id='test' value="1" >nihao</input>
</body>
</html>